home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / pov / povlisti.ngs / truchet4.pov < prev    next >
Encoding:
Text File  |  1992-05-08  |  4.8 KB  |  169 lines

  1. // Persistence of Vision Raytracer Version 1.0
  2. // Metallic blue Truchet tiles framed in acrylic.
  3. #include "colors.inc"
  4. #include "shapes.inc"
  5. #include "textures.inc"
  6.  
  7. camera {
  8.     location <15 50 -60>
  9.     direction <0 0 4>
  10.     up  <0 1 0>
  11.     right <1.33333 0 0>
  12.     look_at <0 1 0>
  13. }
  14.  
  15. object {
  16.    light_source { <5 50 -50>
  17.    colour red 0.85 green 0.85 blue 0.85
  18.    spotlight
  19.    point_at <0 0 0>
  20.    tightness 60
  21.    radius 8
  22.    falloff 16
  23.     }
  24. }
  25. object {
  26.    light_source { <5 100 150>
  27.    colour red 0.2 green 0.2 blue 0.2
  28.    spotlight
  29.    point_at <0 0 0>
  30.    tightness 60
  31.    radius 8
  32.    falloff 16
  33.     }
  34. }
  35.  
  36.  
  37. #declare Plexiglass = texture {
  38.     color red 0.9 green 0.9 blue 1.0 alpha 0.9
  39.     ambient 0.0
  40.     diffuse 0.1
  41.     reflection 0.15
  42.     refraction 0.75
  43.     ior 1.45
  44.     specular 0.5
  45.     roughness 0.2
  46. }
  47.  
  48. //  Outer radius: 1.25  Inner radius: 0.75
  49. #declare Torus = quartic {
  50.    <    1.000000 0.000000 0.000000 0.000000 2.000000
  51.         0.000000 0.000000 2.000000 0.000000 -2.125000
  52.         0.000000 0.000000 0.000000 0.000000 0.000000
  53.         0.000000 0.000000 0.000000 0.000000 0.000000
  54.         1.000000 0.000000 0.000000 2.000000 0.000000
  55.         1.875000 0.000000 0.000000 0.000000 0.000000
  56.         1.000000 0.000000 -2.125000 0.000000 0.878906 >
  57.  }/* end_quartic */
  58.  
  59. // This really should be just a CSG, with no texture at this point, but
  60. // a current limitation in the parser won't allow me to CLIP without
  61. // declaring the piece as an object.  I could've used an intersection
  62. // instead, but with much more overhead, too.
  63. #declare Quarter_Torus = object {
  64.   quartic { Torus rotate <90 0 0>  }
  65.   clipped_by {
  66.       plane { <-1 0 0> 0  }
  67.       plane { <0  1 0> 0  }
  68.    }
  69.   color Red
  70.   texture {
  71.       color SteelBlue
  72.       ambient 0.2
  73.       diffuse 0.8
  74.       reflection 0.25
  75.       brilliance 8.0
  76.       specular 1
  77.       roughness 0.001
  78.    }
  79. }
  80.  
  81.  
  82. // A tile is a square space with opposing corners having symmetrical patterns
  83. // so the patterns will still match up when rotated 90 degrees.
  84.  
  85. #declare Tile = composite {
  86.     object { Quarter_Torus translate <-1 1 0>  }/* end_object */
  87.     object { Quarter_Torus rotate <0 0 180> translate <1 -1 0>  }/* end_object */
  88.     bounded_by {
  89.         sphere { <0 0 0> 1.77  }
  90.      }
  91. }
  92. // A special code generator that I wrote "flips" the tiles by 90 degrees
  93. // based on a random "coinflip".  To keep things clearer,  I've designed
  94. // each attitude as a separate tile piece.
  95. #declare EvenTile = composite {
  96.     composite { Tile  }
  97. }
  98. #declare OddTile = composite {
  99.     composite { Tile  }
  100.     rotate <0 0 90>
  101. }
  102.  
  103. // read in the file holding the truchet tile grid data
  104. #include "tile.inc"
  105.  
  106.  
  107. // Build a Plexiglass frame.  Four separate pieces are used so that each
  108. // can have a slightly different pattern to the woodgrain.
  109. #declare XFramePiece1 = object { box { UnitBox scale <6.5 0.5 0.5> }
  110.     texture { Plexiglass rotate <0 -85 0> translate <-3 0 0> }
  111. }
  112. #declare XFramePiece2 = object { box { UnitBox scale <6.5 0.5 0.5> }
  113.     texture { Plexiglass  rotate <0 90 0> translate <-2.5 0 0> }
  114. }
  115. #declare YFramePiece1 = object { box { UnitBox scale <0.5 6.5 0.5> }
  116.     texture { Plexiglass  rotate <0 0 0> translate <85 0 1> }
  117. }
  118. #declare YFramePiece2 = object { box { UnitBox scale <0.5 6.5 0.5> }
  119.     texture { Plexiglass  rotate <0 5 0> translate <87 0 -1>}
  120. }
  121.  
  122. // Threaded rod,  4 will be used to hold the frame together at the corners
  123. #declare Rod = object {
  124.     intersection {Z_Disk scale <0.25 0.25 7> }
  125.     texture { Chrome_Texture
  126.         gradient <0 0 1>                        // threads
  127.         color_map {
  128.             [0.0 0.5 color DimGray color LightGray ]
  129.             [0.5 1.0 color LightGray color DimGray ]
  130.         }
  131.         scale <1 1 0.1>
  132.         rotate <0 1 0>                          // pitch the threads a bit
  133.     }
  134. }
  135.  
  136. // This is one complete unit which will be repeated four times below.
  137. #declare Piece = composite {
  138.     composite { Tiles }
  139.     object {XFramePiece1 translate <0.5 -6.5 0> }
  140.     object {YFramePiece1 rotate <0 0 180> translate <-6.5 -0.5 0> }
  141.     object {XFramePiece2 rotate <0 0 180> translate <-0.5  6.5 0> }
  142.     object {YFramePiece2 translate < 6.5 0.5 0> }
  143. }
  144.  
  145.  
  146. // Build the finished piece.  3 copies of the framed object are stacked
  147. // along the Z axis, and are tied together with steel rods in each of the
  148. // four corners.
  149. composite {
  150.     composite {Piece}
  151.     composite {Piece rotate <0 0 180> translate <0 0 6> }
  152.     composite {Piece rotate <0 0 90> translate <0 0 -6> }
  153.  
  154.  
  155.     object { Rod  translate <-6.5  6.5 0> }
  156.     object { Rod  translate <-6.5 -6.5 0> }
  157.     object { Rod  translate < 6.5 -6.5 0> }
  158.     object { Rod  translate < 6.5  6.5 0> }
  159. }
  160.  
  161. // A floor plane
  162. object {
  163.     plane { <0 1 0> -7 }
  164.     texture {
  165.         color DimGray
  166.         reflection 0.25
  167.     }
  168. }
  169.